<template>
  <div class="loading">
    <div class="load-box">
      <img :src="LOADINGIMAGE[LOADINGINDEX]" alt="" />
      <p>加载中...</p>
      <div class="btn">
        <van-button type="warning" size="small" @click="cancal"
          >取消</van-button
        >
      </div>
    </div>
  </div>
</template>
  
  <script>
import { mapState } from "vuex";

export default {
  name: "LOADING",
  methods: {
    cancal() {
      this.$store.commit("hideLoading");
    },
  },
  computed: {
    ...mapState(["LOADINGINDEX", "LOADINGIMAGE"]),
  },
};
</script>
  <style lang="scss" scoped>
.loading {
  position: fixed;
  z-index: 9999;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  .load-box {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    flex-direction: column;
    border-radius: 15px;
    width: 60%;
    height: 160px;
    position: relative;
    img {
      width: 50px;
      height: auto;
      margin-bottom: 10px;
    }
    p {
      color: #607d8b;
      margin-bottom: 10px;
    }
    .btn {
      position: absolute;
      right: 10px;
      bottom: 10px;
    }
  }
}
</style>